package com.ruoyi.common.core.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import java.util.Date;

/**
 * 图片对象 picture
 *
 * @author dam
 * @date 2023-07-10
 */
@Data
public class Picture {
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 逻辑删除 0：未删除 1：已删除
     */
    @Excel(name = "逻辑删除 0：未删除 1：已删除")
    @TableLogic
    @TableField("is_deleted")
    private Long isDeleted;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private Date updateTime;

    /**
     * 图片地址
     */
    @Excel(name = "图片地址")
    private String address;

    /**
     * 对应商品id/评论id
     */
    @Excel(name = "对应商品id/评论id")
    private Long itemId;

    /**
     * 类型0:商品图片,1:评论图片
     */
    @Excel(name = "类型0:商品图片,1:评论图片")
    private Integer type;

    /**
     * 高宽比
     */
    private Double aspectRatio;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .append("isDeleted", getIsDeleted())
                .append("address", getAddress())
                .append("itemId", getItemId())
                .append("type", getType())
                .toString();
    }
}
